Cocktail Help Reference
GetObject Method
See Also  Send Feedback
Cocktail Assembly > Cocktail Namespace > ObjectManager<TKey,T> Class : GetObject Method



key
The key used to look up the instance. If the key is encountered for the first time, a new instance will be created.

Glossary Item Box

Retrieves an object instance by key. If the key hasn't been encountered before, a new instance will be created.

Syntax

Visual Basic (Declaration) 
Public Function GetObject( _
   ByVal key As TKey _
) As T
Visual Basic (Usage)Copy Code
Dim instance As ObjectManager(Of TKey,T)
Dim key As TKey
Dim value As T
 
value = instance.GetObject(key)
C# 
public T GetObject( 
   TKey key
)
C++/CLI 
public:
T^ GetObject( 
   TKey^ key
) 

Parameters

key
The key used to look up the instance. If the key is encountered for the first time, a new instance will be created.

Return Value

An existing or new instance matching the key.

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2013 All Rights Reserved.